/**
 * @file timer_clock.h
 *
 */
#ifndef TIMER_CLOCK_H
#define TIMER_CLOCK_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_TIMER

/*********************
 *      DEFINES
 *********************/
#define TIMER_ITEM_NUM  9

/**********************
 *      TYPEDEFS
 **********************/
enum {
    TIMER_STATE_IDLE,
    TIMER_STATE_RUN,
    TIMER_STATE_PAUSE,
    TIMER_STATE_TIMEOUT,
};
typedef uint8_t timer_state_t;

enum {
    TIMER_1_MIN = 0,
    TIMER_3_MIN,
    TIMER_5_MIN,
    TIMER_10_MIN,
    TIMER_15_MIN,
    TIMER_30_MIN,
    TIMER_1_HOUR,
    TIMER_2_HOUR,
    TIMER_CUSTOM,
};
typedef uint8_t timer_num_t;

typedef struct {
    timer_num_t num;
    watchLangTxtId_t txt_id;
    uint32_t duration; //ms
} timer_item_t;

typedef struct {
    lv_watch_obj_ext_t lv_watch_obj;
    /*New data for this type */
    lv_obj_t * roller[3];
    char sel_str[3][6];
} lv_timer_list_obj_ext_t;

typedef struct {
    lv_watch_obj_ext_t lv_watch_obj;
    /*New data for this type */
    lv_obj_t * label_info;
    lv_obj_t * label_time_remaining;
    lv_obj_t * arc_time_remaining;
    lv_obj_t * btn_start;
    lv_obj_t * btn_pause;
} lv_timer_obj_ext_t;

/**********************
 * GLOBAL PROTOTYPES
 **********************/
void timer_create_event_cb(lv_obj_t * btn, lv_event_t e);

/**********************
 *      MACROS
 **********************/

#endif /*USE_LV_WATCH_TIMER*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*TIMER_CLOCK_H*/
